**********************
* Analyses Chapter 8 *
**********************


use "Elites five countries all GGIs.dta"


tab leftright
recode leftright 5.5=6 // one observation changed

* measurement (in text)
*************

tab country

sum confios confICC confIMF confUN confWB confWHO confWTO
sort country
by country: sum confios

tab education
tab edu_3
sort country
by country: tab edu_3

by country: sum finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction experience_IOs


* Table 8.1 
***********

regress confios i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction experience_IOs ib4.area_4 i.elitecat i.Orientation age male i.country
estat vif
eststo tab821

regress confICC i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction expICC ib4.area_4 i.elitecat i.Orientation  age male i.country
estat vif
eststo tab822

regress confIMF i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction expIMF ib4.area_4 i.elitecat i.Orientation  age male i.country
estat vif
eststo tab823

regress confUN i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction expUN ib4.area_4 i.elitecat i.Orientation  age male i.country
estat vif
eststo tab824

regress confWB i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction expWB ib4.area_4 i.elitecat i.Orientation  age male i.country
estat vif
eststo tab825

regress confWHO i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction expWHO ib4.area_4 i.elitecat i.Orientation  age male i.country
estat vif
eststo tab826

regress confWTO i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction expWTO ib4.area_4 i.elitecat i.Orientation  age male i.country
estat vif
eststo tab827


#delimit ;
esttab tab821 tab822 tab823 tab824 tab825 tab826 tab827   using chapter8table2.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f)  nodepvars se
 replace;
#delimit cr

pwcorr confgov polsatisfaction, sig


* Table 8.2
***********
* per country, pooled

sort country
by country: ktau confios edu_3 , stats(taub se)
by country: pwcorr confios finsathousehold , sig
by country: pwcorr confios  leftright , sig
by country: pwcorr confios  GAL , sig
by country: pwcorr confios  feelworld , sig
by country: pwcorr confios  feelcountry , sig
by country: pwcorr confios  confgov , sig
by country: pwcorr confios  polsatisfaction, sig


* Table 8.3
***********
* per country, per IOs

sort country
by country: ktau confICC edu_3 , stats(taub se)
by country: pwcorr confICC finsathousehold , sig
by country: pwcorr confICC  leftright , sig
by country: pwcorr confICC  GAL , sig
by country: pwcorr confICC  feelworld , sig
by country: pwcorr confICC  feelcountry , sig
by country: pwcorr confICC  confgov , sig
by country: pwcorr confICC  polsatisfaction, sig

by country: ktau confIMF edu_3 , stats(taub se)
by country: pwcorr confIMF finsathousehold , sig
by country: pwcorr confIMF  leftright , sig
by country: pwcorr confIMF  GAL , sig
by country: pwcorr confIMF  feelworld , sig
by country: pwcorr confIMF  feelcountry , sig
by country: pwcorr confIMF  confgov , sig
by country: pwcorr confIMF  polsatisfaction, sig

by country: ktau confUN edu_3 , stats(taub se)
by country: pwcorr confUN finsathousehold , sig
by country: pwcorr confUN  leftright , sig
by country: pwcorr confUN  GAL , sig
by country: pwcorr confUN  feelworld , sig
by country: pwcorr confUN  feelcountry , sig
by country: pwcorr confUN  confgov , sig
by country: pwcorr confUN  polsatisfaction, sig

by country: ktau confWB edu_3 , stats(taub se)
by country: pwcorr confWB finsathousehold , sig
by country: pwcorr confWB  leftright , sig
by country: pwcorr confWB  GAL , sig
by country: pwcorr confWB  feelworld , sig
by country: pwcorr confWB  feelcountry , sig
by country: pwcorr confWB  confgov , sig
by country: pwcorr confWB  polsatisfaction, sig

by country: ktau confWHO edu_3 , stats(taub se)
by country: pwcorr confWHO finsathousehold , sig
by country: pwcorr confWHO  leftright , sig
by country: pwcorr confWHO  GAL , sig
by country: pwcorr confWHO  feelworld , sig
by country: pwcorr confWHO  feelcountry , sig
by country: pwcorr confWHO  confgov , sig
by country: pwcorr confWHO  polsatisfaction, sig

by country: ktau confWTO edu_3 , stats(taub se)
by country: pwcorr confWTO finsathousehold , sig
by country: pwcorr confWTO  leftright , sig
by country: pwcorr confWTO  GAL , sig
by country: pwcorr confWTO  feelworld , sig
by country: pwcorr confWTO  feelcountry , sig
by country: pwcorr confWTO  confgov , sig
by country: pwcorr confWTO  polsatisfaction, sig



* Figures
*********


set scheme plotplain

* Figure 8.1
************

* confgov

label define conf 0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal"
label values confgov conf

#delimit ;
graph bar confios, 
over(confgov, sort(descending)) 
 ytitle("Average confidence in IOs")  title(All countries)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_all.gph, replace)
;
#delimit cr

#delimit ;
graph bar confios if country==76, 
over(confgov, sort(descending)) 
 ytitle("Average confidence in IOs") title(Brazil)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_bra.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==276, 
over(confgov, sort(descending)) 
 ytitle("Average confidence in IOs") title(Germany)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_de.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==608, 
over(confgov, sort(descending)) 
 ytitle("Average confidence in IOs") title(Philippines)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_phi.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==643, 
over(confgov, sort(descending)) 
 ytitle("Average confidence in IOs") title(Russia)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_rus.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==840, 
over(confgov, sort(descending)) 
 ytitle("Average confidence in IOs") title(US)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_us.gph, replace)
;
#delimit cr

graph combine fig_1_all.gph fig_1_bra.gph fig_1_de.gph fig_1_phi.gph ///
fig_1_rus.gph fig_1_us.gph, ycommon col(2)


* Figure 8.2

* polsatisfaction

#delimit ;
graph bar confios, 
over(polsatisfaction, sort(descending) ) 
 ytitle("") title(All countries)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_all.gph, replace)
;
#delimit cr

#delimit ;
graph bar confios if country==76, 
over(polsatisfaction, sort(descending) ) 
 ytitle("") title(Brazil)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_bra.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==276, 
over(polsatisfaction, sort(descending) ) 
 ytitle("") title(Germany)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_de.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==608, 
over(polsatisfaction, sort(descending) ) 
 ytitle("") title(Philippines)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_phi.gph, replace)
;
#delimit cr

label define ps 0 "0" 1 "1" 2 "2" 3 "3" 4 "4" 5 "5" 6 "6" 7 "7" 8 "8" 9 "9" , modify
label values polsatisfaction ps 
decode polsatisfaction, gen(ps)
tab ps
ed ps polsatisfaction confios if polsatisfaction==.& country==643

preserve
replace ps="9" in 499 
replace confios=0 in 499
#delimit ;
graph bar confios if country==643, 
over(ps, sort(descending) ) 
 ytitle("") title(Russia)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_rus.gph, replace)
;
#delimit cr

ed ps polsatisfaction confios if polsatisfaction==.& country==840

preserve
replace ps="9" in 399 
replace ps="9" in 467 
replace confios=0 in 399
replace confios=0 in 467
#delimit ;
graph bar confios if country==840, 
over(ps, sort(descending)) 
 ytitle("") title(US)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_us.gph, replace)
;
#delimit cr

graph combine fig_1_all.gph fig_1_bra.gph fig_1_de.gph fig_1_phi.gph ///
fig_1_rus.gph fig_1_us.gph, ycommon col(3)


* Figure 8.3
* edu_3


label define edu_3 1 "Bachelor or lower" 2 "Master or equivalent" 3 "Doctorate or equivalent", modify
label values edu_3 edu_3 
splitvallabels edu_3 
label values edu_3
#delimit ;
graph bar confios, 
over(edu_3, relabel(`r(relabel)') sort(descending)) 
 ytitle("") title(All countries)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_all.gph, replace)
;
#delimit cr

label define edu_3 1 "Bachelor or lower" 2 "Master or equivalent" 3 "Doctorate or equivalent", modify
label values edu_3 edu_3 
splitvallabels edu_3 
label values edu_3
#delimit ;
graph bar confios if country==76, 
over(edu_3, relabel(`r(relabel)') sort(descending)) 
 ytitle("") title(Brazil)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_bra.gph, replace)
;
#delimit cr

label define edu_3 1 "Bachelor or lower" 2 "Master or equivalent" 3 "Doctorate or equivalent", modify
label values edu_3 edu_3 
splitvallabels edu_3 
label values edu_3
#delimit ;
graph bar confios if country==276, 
over(edu_3, relabel(`r(relabel)') sort(descending)) 
 ytitle("") title(Germany)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_de.gph, replace)
;
#delimit cr

label define edu_3 1 "Bachelor or lower" 2 "Master or equivalent" 3 "Doctorate or equivalent", modify
label values edu_3 edu_3 
splitvallabels edu_3 
label values edu_3
#delimit ;
graph bar confios if country==608, 
over(edu_3, relabel(`r(relabel)')  sort(descending)) 
 ytitle("") title(Philippines)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_phi.gph, replace)
;
#delimit cr

label define edu_3 1 "Bachelor or lower" 2 "Master or equivalent" 3 "Doctorate or equivalent", modify
label values edu_3 edu_3 
splitvallabels edu_3 
label values edu_3
#delimit ;
graph bar confios if country==643, 
over(edu_3, relabel(`r(relabel)') sort(descending)) 
 ytitle("") title(Russia)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_rus.gph, replace)
;
#delimit cr

label define edu_3 1 "Bachelor or lower" 2 "Master or equivalent" 3 "Doctorate or equivalent", modify
label values edu_3 edu_3 
splitvallabels edu_3 
label values edu_3
#delimit ;
graph bar confios if country==840, 
over(edu_3, relabel(`r(relabel)') sort(descending)) 
 ytitle("") title(US)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_us.gph, replace)
;
#delimit cr

graph combine fig_1_all.gph fig_1_bra.gph fig_1_de.gph fig_1_phi.gph ///
fig_1_rus.gph fig_1_us.gph, ycommon col(3)



* Figure 8.4
* finsathousehold

#delimit ;
graph bar confios, 
over(finsathousehold, sort(descending)) 
 ytitle("") title(All countries)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_all.gph, replace)
;
#delimit cr

#delimit ;
graph bar confios if country==76, 
over(finsathousehold, sort(descending)) 
 ytitle("") title(Brazil)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_bra.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==276, 
over(finsathousehold, sort(descending)) 
 ytitle("") title(Germany)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_de.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==608, 
over(finsathousehold, sort(descending)) 
 ytitle("") title(Philippines)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_phi.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==643, 
over(finsathousehold, sort(descending)) 
 ytitle("") title(Russia)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_rus.gph, replace)
;
#delimit cr


label values finsathousehold ps 
decode finsathousehold, gen(fh)
tab fh
ed fh finsathousehold confios if finsathousehold==.& country==840

preserve
replace fh="0" in 432 
replace confios=0 in 432
#delimit ;
graph bar confios if country==840, 
over(fh, sort(descending)) 
 ytitle("") title(US)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_us.gph, replace)
;
#delimit cr

graph combine fig_1_all.gph fig_1_bra.gph fig_1_de.gph fig_1_phi.gph ///
fig_1_rus.gph fig_1_us.gph, ycommon col(3)


* Figure 8.5

* leftright

replace leftright=6 if leftright==5.5

#delimit ;
graph bar confios, 
over(leftright, sort(descending)) 
 ytitle("") title(All countries)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_all.gph, replace)
;
#delimit cr

#delimit ;
graph bar confios if country==76, 
over(leftright, sort(descending)) 
 ytitle("") title(Brazil)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_bra.gph, replace)
;
#delimit cr

label values leftright ps 
decode leftright, gen(lr)
tab lr if country==276
ed lr leftright confios if leftright==.& country==276

preserve
replace lr="8" in 308 
expand 2 in 599
replace lr="9" in 600 
replace country=276 in 600  

replace confios=0 in 308
replace confios=0 in 600
#delimit ;
graph bar confios if country==276, 
over(lr, sort(descending)) 
 ytitle("") title(Germany)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_de.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==608, 
over(leftright, sort(descending)) 
 ytitle("") title(Philippines)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_phi.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==643, 
over(leftright, sort(descending)) 
 ytitle("") title(Russia)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_rus.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==840, 
over(leftright, sort(descending)) 
 ytitle("") title(US)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_us.gph, replace)
;
#delimit cr

graph combine fig_1_all.gph fig_1_bra.gph fig_1_de.gph fig_1_phi.gph ///
fig_1_rus.gph fig_1_us.gph, ycommon col(3)


* Figure 8.6

* GAL-TAN

#delimit ;
graph bar confios, 
over(GAL, sort(descending) relabel(1 "TAN" 2 "GAL")) 
 ytitle("") title(All countries)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_all.gph, replace)
;
#delimit cr

#delimit ;
graph bar confios if country==76, 
over(GAL, sort(descending) relabel(1 "TAN" 2 "GAL")) 
 ytitle("") title(Brazil)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_bra.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==276, 
over(GAL, sort(descending) relabel(1 "TAN" 2 "GAL")) 
 ytitle("") title(Germany)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_de.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==608, 
over(GAL, sort(descending) relabel(1 "TAN" 2 "GAL")) 
 ytitle("") title(Philippines)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_phi.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==643, 
over(GAL, sort(descending) relabel(1 "TAN" 2 "GAL")) 
 ytitle("") title(Russia)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_rus.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==840, 
over(GAL, sort(descending) relabel(1 "TAN" 2 "GAL")) 
 ytitle("") title(US)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_us.gph, replace)
;
#delimit cr

graph combine fig_1_all.gph fig_1_bra.gph fig_1_de.gph fig_1_phi.gph ///
fig_1_rus.gph fig_1_us.gph, ycommon col(2)



* Figure 8.7

* feelworld

#delimit ;
graph bar confios, 
over(feelworld, sort(descending)) 
 ytitle("") title(All countries)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_all.gph, replace)
;
#delimit cr

#delimit ;
graph bar confios if country==76, 
over(feelworld, sort(descending)) 
 ytitle("") title(Brazil)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_bra.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==276, 
over(feelworld, sort(descending)) 
 ytitle("") title(Germany)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_de.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==608, 
over(feelworld, sort(descending)) 
 ytitle("") title(Philippines)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_phi.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==643, 
over(feelworld, sort(descending)) 
 ytitle("") title(Russia)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_rus.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==840, 
over(feelworld, sort(descending)) 
 ytitle("") title(US)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_us.gph, replace)
;
#delimit cr

graph combine fig_1_all.gph fig_1_bra.gph fig_1_de.gph fig_1_phi.gph ///
fig_1_rus.gph fig_1_us.gph, ycommon col(2)




* Figure 8.8

* feelcountry

#delimit ;
graph bar confios, 
over(feelcountry, sort(descending)) 
 ytitle("") title(All countries)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_all.gph, replace)
;
#delimit cr

label define feel 0 "0" 1 "1" 2 "2" 3 "3"
label values feelcountry feel 
decode feelcountry, gen(fc) 
ed fc feelcountry confios if feelcountry==.& country==76

preserve
replace fc="0" in 88 
replace confios=0 in 88
#delimit ;
graph bar confios if country==76, 
over(fc, sort(descending)) 
 ytitle("") title(Brazil)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_bra.gph, replace)
;
#delimit cr

label values feelcountry feel 
decode feelcountry, gen(fc)
tab fc if country==276
ed fc feelcountry confios if feelcountry==.& country==276

preserve
replace fc="0" in 308 
replace confios=0 in 308
#delimit ;
graph bar confios if country==276, 
over(fc, sort(descending)) 
 ytitle("") title(Germany)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_de.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==608, 
over(feelcountry, sort(descending)) 
 ytitle("") title(Philippines)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_phi.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==643, 
over(feelcountry, sort(descending)) 
 ytitle("") title(Russia)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_rus.gph, replace)
;
#delimit cr


#delimit ;
graph bar confios if country==840, 
over(feelcountry, sort(descending)) 
 ytitle("") title(US)
 ylabel(0 "None at all" 1 "Not very much" 2 "Quite a lot" 3 "A great deal", 
 labsize(small) labcolor(black) angle(horizontal) ///
 glcolor(gs14) gmax) bar(3, color(g2)) legend(col(1) size(medsmall))
 saving(fig_1_us.gph, replace)
;
#delimit cr

graph combine fig_1_all.gph fig_1_bra.gph fig_1_de.gph fig_1_phi.gph ///
fig_1_rus.gph fig_1_us.gph, ycommon col(2)






*********
* appendix/ robustness checks
*********

*****************
* Print appendix
*****************

* Appendix B descriptives

tab edu_3
sum confios confICC confIMF confUN confWB confWHO confWTO finsathousehold leftright feelworld feelcountry confgov polsatisfaction age male gentrust knowledge_DK0 experience_IOs expICC expIMF expUN expWB expWHO expWTO
tab gentrust
tab know_all // variable used in analyses as most respondents have 2 or all 3 questions correct
tab GAL
tab area_4
tab elitecat
tab Orientation

* Appendix E
* bivariate correlation all IVs
pwcorr edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction age male gentrust knowledge_DK0, sig obs




*****************
* Online appendix
*****************

* Online Appendix H
* exclude confgov

regress confios i.edu_3 finsathousehold leftright GAL feelworld feelcountry  polsatisfaction experience_IOs ib4.area_4 i.elitecat i.Orientation  age male i.country
eststo tab821_b

regress confICC i.edu_3 finsathousehold leftright GAL feelworld feelcountry  polsatisfaction expICC ib4.area_4 i.elitecat i.Orientation  age male i.country
eststo tab822_b

regress confIMF i.edu_3 finsathousehold leftright GAL feelworld feelcountry  polsatisfaction expIMF ib4.area_4 i.elitecat i.Orientation  age male i.country
eststo tab823_b

regress confUN i.edu_3 finsathousehold leftright GAL feelworld feelcountry  polsatisfaction expUN ib4.area_4 i.elitecat i.Orientation  age male i.country
eststo tab824_b

regress confWB i.edu_3 finsathousehold leftright GAL feelworld feelcountry  polsatisfaction expWB ib4.area_4 i.elitecat i.Orientation  age male i.country
eststo tab825_b

regress confWHO i.edu_3 finsathousehold leftright GAL feelworld feelcountry  polsatisfaction expWHO ib4.area_4 i.elitecat i.Orientation  age male i.country
eststo tab826_b

regress confWTO i.edu_3 finsathousehold leftright GAL feelworld feelcountry  polsatisfaction expWTO ib4.area_4 i.elitecat i.Orientation  age male i.country
eststo tab827_b


#delimit ;
esttab tab821_b tab822_b tab823_b tab824_b tab825_b tab826_b tab827_b   using chapter8app8Bconfgov.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f)  nodepvars se
 replace;
#delimit cr


* Online Appendix I
* exclude polsatisfaction

regress confios i.edu_3 finsathousehold leftright GAL feelworld feelcountry  confgov ib4.area_4 i.elitecat i.Orientation experience_IOs age male i.country
eststo tab821_c

regress confICC i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov  ib4.area_4 i.elitecat i.Orientation expICC age male i.country
eststo tab822_c

regress confIMF i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov  ib4.area_4 i.elitecat i.Orientation expIMF age male i.country
eststo tab823_c

regress confUN i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov  ib4.area_4 i.elitecat i.Orientation expUN age male i.country
eststo tab824_c

regress confWB i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov  ib4.area_4 i.elitecat i.Orientation expWB age male i.country
eststo tab825_c

regress confWHO i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov  ib4.area_4 i.elitecat i.Orientation expWHO age male i.country
eststo tab826_c

regress confWTO i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov  ib4.area_4 i.elitecat i.Orientation expWTO age male i.country
eststo tab827_c

#delimit ;
esttab tab821_c tab822_c tab823_c tab824_c tab825_c tab826_c tab827_c   using chapter8app8Bpolsat.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f)  nodepvars se
 replace;
#delimit cr





* Online Appendix J
* meditation social trust

pwcorr gentrust confios confICC confIMF confUN confWB confWHO confWTO confgov, sig

* Mediation analysis (Baron and Kenny)

//Step 1: See Table 8.1
//	IF there is a relationship between domestic trust and IO confidence, proceed to step 2.
//Step 2: regression as in Table 8.1 but excluding confidence in government, resp. political satisfaction, and including social trust.
//	IF there is a relationship between social trust and IO confidence, proceed to step 3.
//Step 3: include all variables above in the model.
//	IF the relationship between domestic trust and confidence in IOs weakens then there is mediation by social trust.


* Step 1 is Table 8.1 -> yes, there is a relationship between domestic trust and IO confidence for all except WHO.

* Step 2: replicate Table 8.1, yet respectively drop confidence in government and political satisfaction, and add social trust instead.

* replace confgov by gentrust
regress confio i.edu_3 finsathousehold leftright GAL feelworld feelcountry gentrust polsatisfaction ib4.area_4 i.elitecat i.Orientation experience_IOs age male i.country
estat vif
eststo tab821

regress confICC i.edu_3 finsathousehold leftright GAL feelworld feelcountry gentrust polsatisfaction ib4.area_4 i.elitecat i.Orientation expICC age male  i.country
estat vif
eststo tab822

regress confIMF i.edu_3 finsathousehold leftright GAL feelworld feelcountry gentrust polsatisfaction ib4.area_4 i.elitecat i.Orientation expIMF age male  i.country
estat vif
eststo tab823

regress confUN i.edu_3 finsathousehold leftright GAL feelworld feelcountry gentrust polsatisfaction ib4.area_4 i.elitecat i.Orientation expUN age male  i.country
estat vif
eststo tab824

regress confWB i.edu_3 finsathousehold leftright GAL feelworld feelcountry gentrust polsatisfaction ib4.area_4 i.elitecat i.Orientation expWB age male  i.country
estat vif
eststo tab825

regress confWTO i.edu_3 finsathousehold leftright GAL feelworld feelcountry gentrust polsatisfaction ib4.area_4 i.elitecat i.Orientation expWTO age male  i.country
estat vif
eststo tab827


#delimit ;
esttab tab821 tab822 tab823 tab824 tab825  tab827   using chapter8step2confgov.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f)  nodepvars se
 replace;
#delimit cr

// for the pooled model, there is a direct relationship with gentrust, so for this model proceed to step 3


* replace polsatisfaction with gentrust

regress confio i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov gentrust ib4.area_4 i.elitecat i.Orientation experience_IOs age male i.country
estat vif
eststo tab821

regress confICC i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov gentrust ib4.area_4 i.elitecat i.Orientation expICC age male i.country
estat vif
eststo tab822

regress confIMF i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov gentrust ib4.area_4 i.elitecat i.Orientation expIMF age male i.country
estat vif
eststo tab823

regress confUN i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov gentrust ib4.area_4 i.elitecat i.Orientation expUN age male i.country
estat vif
eststo tab824

regress confWB i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov gentrust ib4.area_4 i.elitecat i.Orientation expWB age male i.country
estat vif
eststo tab825

regress confWTO i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov gentrust ib4.area_4 i.elitecat i.Orientation expWTO age male i.country
estat vif
eststo tab827


#delimit ;
esttab tab821 tab822 tab823 tab824 tab825  tab827   using chapter8step2polsat.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f)  nodepvars se
 replace;
#delimit cr

// for the pooled, IMF, UN, WTO models, there is a direct relationship with gentrust, so for these proceed to step 3
 

regress confios gentrust i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction ib4.area_4 i.elitecat i.Orientation experience_IOs age male  i.country
eststo gentrustios

regress confIMF gentrust i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction ib4.area_4 i.elitecat i.Orientation expIMF age male  i.country
eststo gentrustIMF
// sign gentrust and confgov

regress confUN gentrust i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction ib4.area_4 i.elitecat i.Orientation expUN age male  i.country
eststo gentrustUN
// sign gentrust and confgov

regress confWTO gentrust i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction ib4.area_4 i.elitecat i.Orientation expWTO age male  i.country
eststo gentrustWTO
// sign gentrust and confgov



#delimit ;
esttab  gentrustios  gentrustIMF gentrustUN   gentrustWTO   using chapter8step3gentrust.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f)  nodepvars se
 replace;
#delimit cr




* Online Appendix K - knowledge and experience with IOs

* direct effect of knowledge (experience is in Table 8.1)

regress confio i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction know_all ib4.area_4 i.elitecat i.Orientation experience_IOs age male i.country
estat vif
eststo tab8D1

regress confICC i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction know_all ib4.area_4 i.elitecat i.Orientation expICC age male i.country
estat vif
eststo tab8D2

regress confIMF i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction know_all ib4.area_4 i.elitecat i.Orientation expIMF age male i.country
estat vif
eststo tab8D3

regress confUN i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction know_all ib4.area_4 i.elitecat i.Orientation expUN age male  i.country
estat vif
eststo tab8D4

regress confWB i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction know_all ib4.area_4 i.elitecat i.Orientation expWB age male i.country
estat vif
eststo tab8D5

regress confWHO i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction know_all ib4.area_4 i.elitecat i.Orientation expWHO age male  i.country
estat vif
eststo tab8D6

regress confWTO i.edu_3 finsathousehold leftright GAL feelworld feelcountry confgov polsatisfaction know_all ib4.area_4 i.elitecat i.Orientation expWTO age male  i.country
estat vif
eststo tab8D7


#delimit ;
esttab tab8D1 tab8D2 tab8D3 tab8D4 tab8D5 tab8D6 tab8D7   using chapter8tableD.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f)  nodepvars se
 replace;
#delimit cr


* interactions:

regress confios i.edu_3 finsathousehold leftright GAL feelworld feelcountry c.confgov##i.know_all polsatisfaction ib4.area_4 i.elitecat i.Orientation experience_IOs age male  i.country
eststo confgovknow_ios

regress confios i.edu_3 finsathousehold leftright GAL feelworld feelcountry c.confgov##c.experience_IOs polsatisfaction ib4.area_4 i.elitecat i.Orientation  age male  i.country
eststo confgovexp_ios


regress confICC i.edu_3 finsathousehold leftright GAL feelworld feelcountry c.confgov##i.know_all polsatisfaction ib4.area_4 i.elitecat i.Orientation expICC age male i.country
eststo confgovknow_ICC

regress confICC i.edu_3 finsathousehold leftright GAL feelworld feelcountry c.confgov##c.expICC polsatisfaction ib4.area_4 i.elitecat i.Orientation  age male i.country
eststo confgovexp_ICC


regress confIMF i.edu_3 finsathousehold leftright GAL feelworld feelcountry c.confgov##i.know_all polsatisfaction ib4.area_4 i.elitecat i.Orientation expIMF age male i.country
eststo confgovknow_IMF

regress confIMF i.edu_3 finsathousehold leftright GAL feelworld feelcountry c.confgov##c.expIMF polsatisfaction ib4.area_4 i.elitecat i.Orientation  age male i.country
eststo confgovexp_IMF


regress confUN i.edu_3 finsathousehold leftright GAL feelworld feelcountry c.confgov##i.know_all polsatisfaction ib4.area_4 i.elitecat i.Orientation expUN age male i.country
eststo confgovknow_UN

regress confUN i.edu_3 finsathousehold leftright GAL feelworld feelcountry c.confgov##c.expUN polsatisfaction ib4.area_4 i.elitecat i.Orientation  age male i.country
eststo confgovexp_UN


regress confWB i.edu_3 finsathousehold leftright GAL feelworld feelcountry c.confgov##i.know_all polsatisfaction ib4.area_4 i.elitecat i.Orientation expWB age male i.country
eststo confgovknow_WB

regress confWB i.edu_3 finsathousehold leftright GAL feelworld feelcountry c.confgov##c.expWB polsatisfaction ib4.area_4 i.elitecat i.Orientation  age male i.country
eststo confgovexp_WB


regress confWHO i.edu_3 finsathousehold leftright GAL feelworld feelcountry c.confgov##i.know_all polsatisfaction ib4.area_4 i.elitecat i.Orientation expWHO age male i.country
eststo confgovknow_WHO

regress confWHO i.edu_3 finsathousehold leftright GAL feelworld feelcountry c.confgov##c.expWHO polsatisfaction ib4.area_4 i.elitecat i.Orientation  age male i.country
eststo confgovexp_WHO


regress confWTO i.edu_3 finsathousehold leftright GAL feelworld feelcountry c.confgov##i.know_all polsatisfaction ib4.area_4 i.elitecat i.Orientation expWTO age male i.country
eststo confgovknow_WTO

regress confWTO i.edu_3 finsathousehold leftright GAL feelworld feelcountry c.confgov##c.expWTO polsatisfaction ib4.area_4 i.elitecat i.Orientation  age male i.country
eststo confgovexp_WTO


#delimit ;
esttab  confgovknow_ios confgovknow_ICC confgovknow_IMF confgovknow_UN confgovknow_WB confgovknow_WHO confgovknow_WTO   using chapter8app8Dconfgovknow.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f)  nodepvars se
 replace;
#delimit cr


#delimit ;
esttab  confgovexp_ios confgovexp_ICC confgovexp_IMF confgovexp_UN confgovexp_WB confgovexp_WHO confgovexp_WTO   using chapter8app8Dconfgovexp.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f)  nodepvars se
 replace;
#delimit cr



* Online Appendix L
* PH split file Duterte announcement (14 March 2018)

gen var14March = .
sort date
sort country

// manually code for PH cases: var14March=1 if survey after 14 March 2018, and var14March=0 if survey before 14 March 2018; other countries: var14March remains .

tab var14March //N=63 before 14 March; N=59 after 14 March

sort var14March
by var14March: ktau confICC edu_3 , stats(taub se)
by var14March: pwcorr confICC finsathousehold , sig
by var14March: pwcorr confICC  leftright , sig
by var14March: pwcorr confICC  GAL , sig
by var14March: pwcorr confICC  feelworld , sig
by var14March: pwcorr confICC  feelcountry , sig
by var14March: pwcorr confICC  confgov , sig
by var14March: pwcorr confICC  polsatisfaction, sig



* Online Appendix M
* variance decomposition 

findit iccvar

use "Elites five countries all GGIs.dta", clear

keep ID country confUN confIMF confICC confWB confWHO confWTO

sort ID country
quietly by ID country:  gen dup = cond(_N==1,0,_n)
tab dup // dup = 0 means record is unique,  dup = 1 means record is duplicate, first occurrence,  dup = 2 means record is duplicate, second occurrence
*here, there are two duplicates
ed if dup==1 |dup==2
ed if ID==4332
sum ID
replace ID=8000 in 337
reshape long conf@, i(ID country) j(io) string

xtmixed conf || country: || io: 



 
